<?php
require_once  '../classes/ConnectionDB.php';
require_once  '../classes/TestDataManager.php';
require_once  '../classes/ClasseDataManager.php';
require_once  '../classes/TestStudentiDataManager.php';
require_once  '../classes/TestStudentiManager.php';

$connection =ConnectionDB::getInstance()->connectToDB();

$chiaveTest = $_POST["chiaveTest"];
$codiceStudente = $_POST["codiceStudente"];
$codiceTest = TestDataManager::getInstance()->getTestByKey($connection, $chiaveTest);

$test = TestDataManager::getInstance()->getTestByCodice($connection, $codiceTest);

if($codiceTest != null && TestStudentiDataManager::getInstance()->existTestForStudent($connection, $codiceTest, $chiaveTest, $codiceStudente))
{

}
else
{
    echo 'err';
//    header("Location:login.php?err=1");
}

?>
